﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Data;

namespace DomainInfoLib
{
    public class DiggerServer
    {

        public static RegisterInfo GetResponse(string DomainName)
        {
            
            //-------先找缓存--
            if (DomainInfoCacheTxt.Contains(DomainName))
            {
                return DomainInfoCacheTxt.GetCache(DomainName);
            }
            //-----------------

            RegisterInfo registerInfo = RequsetSever.GetResponseFromAPI(DomainName);

            if (registerInfo == null)
            {
                return null;
            }

            // DomainInfoCache.AddCache(registerInfo);
            DomainInfoCacheTxt.AddCache(registerInfo);
            return registerInfo;

        }

    }
}
